import { defineStore } from 'pinia'

const useListStore = defineStore('list', {
    // state () { },

    // state: () => {
    //     return {
    //          arr:['菠萝','榴莲','香蕉']
    //      }
    //  }
    state: () => ({ arr: ['菠萝', '榴莲', '香蕉'] }),
    actions: {
        addList (payload = null) {
            this.arr.push(payload)
        }
    },
    getters: {
        mapArrList () {
            return this.arr.map(item => item + '你好')
        }
    }
})


export default useListStore